package com.nbjtjc.safe.model.emg;

import com.nbjtjc.common.validator.group.AddGroup;
import com.nbjtjc.common.validator.group.UpdateGroup;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.apache.ibatis.annotations.Update;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

@Table(name = "emg_duty")
public class EmgDuty implements Serializable {
    @Id
    @Column(name = "du_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @NotBlank(message = "更新时duId不能为空",groups = {UpdateGroup.class})
    private Integer duId;

    /**
     * 值班日期
     */
    @Column(name = "duty_date")
    @ApiParam("值班日期")
    @NotBlank(message = "值班时间不能为空",groups = {AddGroup.class, UpdateGroup.class})
    private Date dutyDate;

    /**
     * 值班人员id
     */
    @Column(name = "user_id")
    @ApiParam("值班人员id")
    private Integer userId;

    /**
     * 发布的预警预案的id
     */
    @Column(name = "plan_public_id")
    @ApiParam("发布的预警预案的id")
    @NotBlank(message = "发布预案的id不能为空",groups = {AddGroup.class, UpdateGroup.class})
    private Integer planPublicId;

    @Transient
    @ApiParam("值班人员名字,当userId不为0是从sys_user中查询出来的，不是存储字段")
    private String userName;

    @Column(name = "name")
    @ApiParam("用户名")
    private String name;

    @ApiParam("手机长号")
    private String phone;
    @Column(name = "short_phone")
    @ApiParam("短号")
    private String shortPhone;

    /**
     * 值班人员所属公司的id
     */
    @Column(name = "company_id")
    private Integer companyId;

    private String company;

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getShortPhone() {
        return shortPhone;
    }

    public void setShortPhone(String shortPhone) {
        this.shortPhone = shortPhone;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * @return du_id
     */
    public Integer getDuId() {
        return duId;
    }

    /**
     * @param duId
     */
    public void setDuId(Integer duId) {
        this.duId = duId;
    }

    /**
     * 获取值班日期
     *
     * @return duty_date - 值班日期
     */
    public Date getDutyDate() {
        return dutyDate;
    }

    /**
     * 设置值班日期
     *
     * @param dutyDate 值班日期
     */
    public void setDutyDate(Date dutyDate) {
        this.dutyDate = dutyDate;
    }

    /**
     * 获取值班人员id
     *
     * @return user_id - 值班人员id
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 设置值班人员id
     *
     * @param userId 值班人员id
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取发布的预警预案的id
     *
     * @return plan_public_id - 发布的预警预案的id
     */
    public Integer getPlanPublicId() {
        return planPublicId;
    }

    /**
     * 设置发布的预警预案的id
     *
     * @param planPublicId 发布的预警预案的id
     */
    public void setPlanPublicId(Integer planPublicId) {
        this.planPublicId = planPublicId;
    }
}